package Homework4

import akka.actor.Actor

class AActor extends Actor {
  override def receive: Receive = {
    case "BActor(乔峰):挺猛，看我降龙十八掌...第1掌" =>
      Thread.sleep(1000)
      println("AActor(黄飞鸿):厉害！佛山无影脚 第1脚")
      sender() ! "AActor(黄飞鸿):厉害！佛山无影脚 第1脚"
    case "BActor(乔峰):挺猛，看我降龙十八掌...第2掌" =>
      Thread.sleep(1000)
      println("AActor(黄飞鸿):厉害！佛山无影脚 第2脚")
      sender() ! "AActor(黄飞鸿):厉害！佛山无影脚 第2脚"
      context.stop(self)
      context.system.terminate()
  }
}
